﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data.Objects.DataClasses;
using SCMS.Model;
using SCMS.Utils.DTOs;

namespace SCMS.CoreBusinessLogic.PurchaseOrder
{
    public interface IPurchaseOrderService
    {
        bool SavePuchaseOrder(Model.PurchaseOrder entity, EntityCollection<Model.PurchaseOrderItem> poItemColl);
        bool SavePuchaseOrder(Model.PurchaseOrder entity);
        bool SavePOItem(Model.PurchaseOrderItem entity);
        void DeletePOItem(Model.PurchaseOrderItem entity);
        void DeletePO(Guid PoId);
        string GenerateUniquNumber(CountryProgramme cp);

        List<Model.OrderRequest> GetPOrderORs(Guid PoId);
        List<Model.PurchaseOrderItem> GetPOItemsByOrId(Guid PoId, Guid OrId);

        List<Model.PurchaseOrder> GetPOs(Guid cpId);
        List<Model.ProjectBudget> GetProjectBudgets();
        List<Model.OrderRequest> GetOrderRequests(Guid countryprogramId);
        List<Model.TenderAnalysi> GetTenderAnalysis(Guid countryprogramId);
        Model.PurchaseOrder GetPurchaseOrderById(Guid Id);
        List<Model.PurchaseOrder> GetPurchaseOrders(Guid countryProgId);
        List<Model.PurchaseOrderItem> GetPurchaseOrderItems(Guid purchaseOrderId);
        Model.PurchaseOrderItem GetPurchaseOrderItemById(Guid id);
        List<Model.PurchaseOrder> GetPurchaseOrdersForReview(SystemUser currentUser);
        List<Model.PurchaseOrder> GetPurchaseOrdersForAuth(SystemUser currentUser);
        bool SaveReviewedPOItem(Model.PurchaseOrderItem poItem);
        bool SaveReviewedPO(Model.PurchaseOrder po);
        List<Model.PurchaseOrder> Search(String refNum);
        bool AuthorizePurchaseOrder(Model.PurchaseOrder po);
        List<Model.PurchaseOrder> GetPurchaseOrdersForRFP(Guid cpId);

        List<PurchaseOrderSummary> Find(List<Guid> ids);
    }
}
